local panli = fk.CreateSkill{
  name = "zy__panli",
  frequency = Skill.Wake,
}
local panli_ = {
  anim_type = "special",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(self) and
      (player.phase == Player.Start or player.phase == player.Finish) and
      player:usedSkillTimes(self.name, Player.HistoryGame) == 0 and
      table.every(player.room.alive_players, function(p) return not p.dying end)
  end,
  can_wake = function(self, event, target, player, data)
    return #player.player_cards[Player.Equip] >= player.hp
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, -1)
    if player.dead then return end
    if not table.contains(player.sealedSlots, Player.JudgeSlot) and player:hasSkill(self) and not player.dead then
      room:abortPlayerArea(player, {Player.JudgeSlot})
    end
    if not player:hasSkill("zy__julue") then
      room:handleAddLoseSkills(player, "zy__julue", nil, true)
    end
  end,
}
panli:addEffect(fk.EventPhaseStart, panli_)
return panli